-
Notifications
You must be signed in to change notification settings - Fork 6
Refactoring Radius 2.0 #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| services.AddSingleton(appVars); | ||
| } | ||
|
|
||
| private static void AddLdapBindNameFormation(IServiceCollection services) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предлагаю эти вещи раскидать по модулям, чтобы сделать честными фичами и избавиться от DI hell
|
|
||
| namespace Multifactor.Radius.Adapter.v2.Application.Features.Ldap.Ports; | ||
|
|
||
| public interface ILdapAdapter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не порт, а толстый неудобный интерфейс. А еще в папке Features/Ldap не нашел собственно фичи. Есть только этот интерфейс имодели
src/Multifactor.Radius.Adapter.v2.Infrastructure/Configurations/Models/ConfigurationFile.cs
Outdated
Show resolved
Hide resolved
src/Multifactor.Radius.Adapter.v2.Infrastructure/Configurations/Reader/ConfigurationReader.cs
Outdated
Show resolved
Hide resolved
src/Multifactor.Radius.Adapter.v2.Infrastructure/Configurations/Reader/ConfigurationReader.cs
Show resolved
Hide resolved
...tor.Radius.Adapter.v2.Infrastructure/Configurations/Reader/ConfigurationBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,45 @@ | |||
| namespace Multifactor.Radius.Adapter.v2.Infrastructure.Adapters.Multifactor.Http; | |||
|
|
|||
| public class ActivityContext | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по хорошему стоит от него отказаться в пользу OpenTelemtry
src/Multifactor.Radius.Adapter.v2.Infrastructure/Logging/SerilogLoggerFactory.cs
Outdated
Show resolved
Hide resolved
src/Multifactor.Radius.Adapter.v2.Infrastructure/Logging/SerilogLoggerFactory.cs
Outdated
Show resolved
Hide resolved
src/Multifactor.Radius.Adapter.v2.Infrastructure/Logging/SerilogLoggerFactory.cs
Outdated
Show resolved
Hide resolved
src/Multifactor.Radius.Adapter.v2.Infrastructure/Logging/StartupLogger.cs
Outdated
Show resolved
Hide resolved
| { | ||
| contentBytes = RadiusPasswordProtector.Encrypt(sharedSecret, authenticator, contentBytes); | ||
| } | ||
| else if (attributeDefinition.Code == 80) // Message-Authenticator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
то же самое
src/Multifactor.Radius.Adapter.v2.Infrastructure/Radius/Builders/RadiusPacketBuilder.cs
Outdated
Show resolved
Hide resolved
| private readonly IRadiusDictionary _radiusDictionary; | ||
| private readonly ILogger<RadiusAttributeParser> _logger; | ||
| const int VendorSpecific = 26; | ||
| const int MessageAuthenticator = 80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
снова те же константы
src/Multifactor.Radius.Adapter.v2.Infrastructure/Radius/Parsers/RadiusAttributeParser.cs
Outdated
Show resolved
Hide resolved
| var content = ParseContentBytes( | ||
| vendorContentBytes, | ||
| vendorAttribute.Type, | ||
| 26, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic number
What's new: